<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>姓名案例_插值语法实现
    </title>
</head>

<body>
    <!--准备好一个容器-->
    <div id="app">
        姓:<input type="text" v-model="first"><br>
        名：<input type="text" v-model="last"><br>
        姓名：<span>{{first.slice(0,3)}}-{{last}}</span>

    </div>
    <!--引入vue-->
    <script src="../../vue.js/vue.js"></script>
    <script>
 Vue.config.productionTip=false//阻止vue在启动时候生成生产提示
        var app = new Vue({
            el: "#app",
            data: {
                first:"张",
                last:"三"

            },
            methods: {

            },
            
        });
    </script>
</body>

</html>